<template>
  <div class="count">
    <h1 ref="getEle">{{count}}</h1>
    <button @click="count++">累加</button>
    <button @click="getAdd">获取ref</button>

  </div>
</template>

<script>
export default {
name:'Count',
data(){
    return{
        count:0,
    }
},
methods: {
    getAdd(){
        console.log(this);
        console.log(this.$refs.getEle);
    }
},

}
</script>

<style>
.count{
    background-color: red;
    height: 200px;
}
</style>